<!--
 * @由于个人水平有限, 难免有些错误, 还请指点:  
 * @Author: cpu_code
 * @Date: 2020-10-20 21:14:38
 * @LastEditTime: 2020-10-20 21:17:53
 * @FilePath: \web\javascript\DOM_innerHTML\DOM_innerHTML.html
 * @Gitee: [https://gitee.com/cpu_code](https://gitee.com/cpu_code)
 * @Github: [https://github.com/CPU-Code](https://github.com/CPU-Code)
 * @CSDN: [https://blog.csdn.net/qq_44226094](https://blog.csdn.net/qq_44226094)
 * @Gitbook: [https://923992029.gitbook.io/cpucode/](https://923992029.gitbook.io/cpucode/)
-->
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>HTMLDOM</title>
    </head>

    <body>
        <div id="div1">
            div cpucode
        </div>

        <script>
            var div = document.getElementById("div1");
            var innerHTML = div.innerHTML;

            document.write(innerHTML);

            //div标签中替换一个文本输入框
            div.innerHTML = "<input type='text'>";

            //div标签中追加一个文本输入框
            div.innerHTML +="<input type='text'>"
        </script>
    </body>
</html>